﻿using System;

namespace EzDeploy.Core
{
    public abstract class BaseAction : IAction
    {
        public virtual string Name
        {
            get { throw new NotImplementedException(); }
        }

        public virtual Menu Menu
        {
            get
            {
                throw  new NotImplementedException();
            }
        }

        public virtual ITask Task
        {
            get
            {
                throw new NotImplementedException();
            }
        }

        protected virtual void OnExecuting(object sender, TaskExecutingEventArgs args)
        {
            var handler = Executing;
            if (handler != null) handler(this, args);
        }

        protected virtual void OnExecuted(object sender, Result args)
        {
            var handler = this.Executed;
            if (handler != null)
                handler(sender, args);
        }

        public event TaskExecutingEventHandler Executing;
        public event TaskExecutedEventHandler Executed;
    }
}